<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "shop");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/index.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/cntable.jsp"%>
<style type="text/css">
.panel{margin-bottom:0px;}
body{
	padding:10px 0px 0px 0px !important;
	overflow: hidden;
}

</style>
<div id="standard" class="col-md-7 col-sm-7" style="border-right:1px solid #ddd;padding-right: 0px;">
	<t:form modelAttribute="standardSearch" cssClass="form-horizontal" method="post" action="/cargo/standard/index" ajaxPost="true" onSuccess="onSuccess">
		<t:panel cssClass="panel-flat border-primary border-top-xlg" customBody="true" customHead="true">	
			<t:panelHead title="规格管理"></t:panelHead>
			<div class="panel-body">
				<div class="row">
					<c:import url="input.jsp" />
				</div>
				<div id="tableContent" class="row" style="overflow:auto;">
					<c:import url="output.jsp" />
				</div>
			</div>			
		</t:panel>
	</t:form>
</div>
<div class="col-md-5 col-sm-5" style="padding-left: 0px;">
	<iframe scrolling="auto" frameborder="0" scrolling="yes" width="100%" height="100%" id="propertyIframe" name="propertyIframe" data-url="<c:url value='/cargo/property/index' />" src=""></iframe>
</div>
<script type="text/javascript">

	$(function(){
		resizeEx();
		$(window).resizeend({delay : 500}, function() {
			resizeEx();
		});
		
		renderTableClick();
	});
	
	function resizeEx(){
		$("#tableContent").height($(window).height()-102);
		$(".panel-body").height($(window).height()-80)
		$("#propertyIframe").height($(window).height()-18);
	}
	
	function renderTableClick(){
		$(".cntable.table tbody tr").on("click",function(){
			var standardId = $(this).attr("data-id");
			var url=$("#propertyIframe").data("url");
			url+="?standardId="+standardId;
			$("#propertyIframe").attr("src",url);
		});
		$(".cntable.table tbody tr:first").click().addClass("select-tr");
		 
	}
	
	function onSuccess(res){
		$("#tableContent").html(res);
		
		redrawTable();
		
		renderTableClick();
	}
	
	function searchCallback(){
		formSubmit();
	}
	function pagerChangeCallback(){
		formSubmit();
	}
	function sortingCallback(){
		formSubmit();
	}
	function formSubmit(){
		$("form:first").submit();	
	}
</script>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared//master/contentFooter.jsp"%>